<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>轮播图</title>
  <link rel="stylesheet" href="../assets/lib/layui/css/layui.css">
  <link rel="stylesheet" href="../assets/css/swiper/swiper.css">
</head>

<body>
  <div class="layui-card">
    <div class="layui-card-header">
      轮播图管理
      <input type="file" name="file" id="swiperFile" style="display: none;" accept="image/*" multiple>
      <button type="button" class="layui-btn layui-btn-normal" id="addSwiper">
        上传图片
        <i class="layui-icon layui-icon-upload-drag"></i>
      </button>
    </div>
    <div class="layui-card-body">
      <table class="layui-table">
        <colgroup>
          <col width="80">
          <col width="230">
          <col width="280">
          <col width="300">
          <col width="150">
        </colgroup>
        <thead>
          <tr>
            <th>ID</th>
            <th>图片预览</th>
            <th>图片路径</th>
            <th>图片状态</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody id="tb">

        </tbody>
      </table>
    </div>
  </div>

  <!-- 查询轮播图模板 -->
  <script type="text/html" id="swiperStr">
  {{each data}}
  <tr>
    <td>{{$value.id}}</td>
    <td>
      <div id="img">
        <img src="{{'http://localhost:8888/uploads/' + $value.swiperimg}} " >
       </div>
    </td>
    <td>{{$value.swiperimg}}</td>
    <td>
      {{if $value.swiperstatus === 1}}
      <button type="button" class="layui-btn layui-btn-primary  layui-btn-xs right" data-status="2" data-id="{{$value.id}}">√</button>
      {{else if $value.swiperstatus === 2}}
      <button type="button" class="layui-btn layui-btn-primary  layui-btn-xs wrong" data-status="1" data-id="{{$value.id}}">×</button>
      {{/if}}
    </td>
    <td>
      <button type="button" class="layui-btn layui-btn-xs layui-btn-danger delBtn" data-id="{{$value.id}}">删除</button>
    </td>
  </tr>
  {{/each}}
  </script>




  <script src="../assets/lib/layui/layui.all.js"></script>
  <script src="../assets/lib/jquery.js"></script>
  <script src="../assets/lib/template-web.js"></script>
  <script src="../assets/js/common.js"></script>
  <script src="../assets/js/swiper/swiper.js"></script>
</body>

</html>